<?php 
session_start();
require_once("include/authen.php");
require_once("include/ui.php");

if ($_SESSION["permission"][$supplierScreen]["View"]=="0"){
	echo "<script>alert('".$no_permit."');</script>";
	echo "<meta http-equiv = refresh ; content = '0 ; url = mainscreen.php'>";
	exit();
}
// show header
echo headerPage("Suppliers Maintenance");
?>

<SCRIPT src="js/js_suppliers.js"></SCRIPT> 
<script>
$(function() {
	$("#ContactTele , #Telephone").keypress(function(e){
		if( e.which!=8 && e.which!=0 && e.which!=45 && (e.which<48 || e.which>57)){
			return false;
		}
	});
	$("#txtCreditTerm_s ,#CreditTerm").keypress(function(e){
		if( e.which!=8 && e.which!=0 && (e.which<48 || e.which>57)){
			return false;
		}
	});
	$( "#txtDateTo" ).datepicker({ dateFormat: 'dd/mm/yy',
		showOn: "button",
		buttonImage: "images/Calendar.png",
		buttonImageOnly: true });
		$("#btnPrint").live('click',function(){
		$("#normal-screen").hide();
		$("#page-header").hide();
		$("#searchdata").hide();
		$(".toolbar-box").hide();
		$("#foolter_table").hide();
		$("#leftboder").hide();
		$("#rightboder").hide();
		
		window.print();
		
		$("#normal-screen").show();
		$("#page-header").show();
		$("#searchdata").show();
		$(".toolbar-box").show();
		$("#foolter_table").show();
		$("#leftboder").show();
		$("#rightboder").show();
	});	
});
</script>
 <link href="./css/style.css" rel="stylesheet" type="text/css" />
<FORM name="Act" action="<?php echo $PHP_SELF?>" method="post"> 
<INPUT type=hidden value="add" id="mode" name="mode"> 
<INPUT type=hidden value="Admin" id="user" name="user"> 
 

<table width="1024" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
 
    <td width="10" id='leftboder' style='border-left:2px solid #facb0c;'>&nbsp;</td>
    <td width="1004" valign="top">
        <div class="content-box">
            <div Class="toolbar-box">   
                <div class="t">
                    <div class="t">
                        <div class="t"></div>
                    </div>
                 </div>
                 <div class="m">
                    <div class="toolbar">
                        <table class="toolbar">
                        <tr>
                            <td>
							<?php  if ($_SESSION["permission"][$supplierScreen]["Add"]=="1") {?>
								<a href="javascript:void('0');" id="btnAdd">
								<span class="icon_add"></span>Add
								</a>
								<?php }?>
							</td>
							  <td>
								<a href="javascript:void('0');" title="Print" id="btnPrint">
								<span class="icon_Print"></span>Print
								</a>
							</td>
                        </tr>
                        </table>
                    </div>
                      <div class="header">
                        Suppliers Maintenance
                      </div>
                <div class="clr"></div>
                 </div>
                 <div class="b">
                    <div class="b">
                        <div class="b"></div>
                    </div>
                 </div>
            </div>
               <div id="element-box">
                <div class="t">
					<div class="t">
						<div class="t"></div>
					</div>
				</div>
                <div class="m">
                    <table width="100%" id='searchdata'>
                        <tr>
                            <td width="15%" class="fontSearch" style="padding-left:20">
                            Supplier Code: 
                            </td>
							<td width="85%" align=left >
							<input id="txtSupplierCode_s"  title="Filter by supplier code"  type="text" size=40 name="txtSupplierCode_s" class="boxItem" />
							</td>
                         </tr>
						<tr>
                      <td class="fontSearch" style="padding-left:20">
								Supplier Name:
							</td>
							<td>
								<input size=40 title="Filter by supplier name" id="txtSupplierName_s" type="text" name="txtSupplierName_s" 	class="boxItem"  />
							</td>
                      </tr>
					  	<tr>
                      <td class="fontSearch" style="padding-left:20" >
								Credit Term:
							</td>
							<td>
								<input title="Filter by Credit Term" maxlength="3" size="10" id="txtCreditTerm_s" type="text"  name="txtCreditTerm_s" 	class="boxItem"  />
								<span  class="fontSearch" >day(s)</span>
							</td>
                      </tr>
						 <tr><td/><td>
						 <a href="javascript:void('0');" id="btnSearch"><img src="./images/btn-search.gif" border=0/></a> </td></tr>
						 <tr><td colspan="2"></tr>
                    </table>
                    <table cellspacing="1" id="resultData" class="list" border=0>
                    <thead>
                       <tr>
							<th width="3%">No.</th>
							<th style="display:none">id</th>
							<th class="title" width="10%">Code</th>
							<th  class="title" width="18%" nowrap="nowrap">Supplier Name</th>
							<th  class="title" width="22%" nowrap="nowrap">Address</th>
							<th  class="title" width="10%" nowrap="nowrap">Telephone</th>
							<th  class="title" width="17%" nowrap="nowrap">Contact</th>
							<th  class="title" width="5%" nowrap="nowrap">Credit Term</th>
							<th  style="display:none" class="title" width="5%" nowrap="nowrap">View</th>
							<th  class="title" width="5%" nowrap="nowrap">Edit</th>
							<th  class="title" width="5%" nowrap="nowrap">Del</th>
                      </tr>
                    </thead>
                   <tbody>
                     </tbody>
                     <tfoot>
                         <tr>
                            <td colspan="10">
							<div class="boxfooter">
								<div id="paging_btn"> </div>
								 <div class="totalpage">Total : <span id="rowCount">0</span>&nbsp;&nbsp;rows</div>
								
							</div>
 							</td>
                         </tr>
                     </tfoot>
                    </table>
                  <div class="clr"></div>
                </div>
                 <div class="b"><div class="b"><div class="b"></div></div></div>
                 <div class="clr"></div>
                </div> <!-- elementbox-->
        </div>
    </td>
    <td width="10"  id='leftboder' style='border-right:2px solid #facb0c;'>&nbsp;</td>
 
  </tr>
</table>
 </FORM>
 
<div id="dialog-confirm" title="Confirm delete?" style="padding-top:20px;">
	<p style="font-size:13px"><span class="ui-icon ui-icon-alert" 
		style="float:left; margin:0 7px 20px 0;">
		</span>Are you sure this supplier?</p>
</div>
<div id="dialog-form" >
	<p class="validateTips">* fields are required.</p>
	<form>
	<table cellpadding="0" cellspacing="0" border="0" width="100%" class="fieldset">
		<tr>
			<td width="30%"><label for="name" >Supplier Code *</label></td>
			<td width="70%"><input type="text" name="SupplierCode"  id="SupplierCode" class="text ui-widget-content ui-corner-all" /></td></tr>
		<tr>
			<td><label for="email">Supplier Name *</label></td>
			<td><input type="text" name="SupplierName" id="SupplierName" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr>
			<td><label for="name">Address *</label></td>
			<td><textarea id="Address"  rows="3" cols="40" class="text ui-widget-content ui-corner-all" ></textarea></td>
		</tr>
		<tr>
			<td><label for="name">Telephone</label></td>
			<td><input type="text" name="Telephone" id="Telephone" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr>
			<td><label for="name">Credit Term </label></td>
			<td><input type="text" name="CreditTerm" size="10" id="CreditTerm" value="" class="text ui-widget-content ui-corner-all" />
			</td>
		</tr>
		<tr>
			<td><label for="name">Contact Name *</label></td>
			<td><input type="text" name="ContactName" id="ContactName" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr>
			<td><label for="name">Contact Tele *</label></td>
			<td><input type="text" name="ContactTele" id="ContactTele" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
		<tr>
			<td><label for="name">Contact Email *</label></td>
			<td><input type="text" name="ContactEmail" id="ContactEmail" value="" class="text ui-widget-content ui-corner-all" /></td>
		</tr>
	</table>
</form>
</div>
<?php echo footer();?>